<?php
$company   = $_GET['company'];
$which_class = "Audio & Multimedia";
$new	   = $_GET['new'];
$popular   = $_GET['popular'];
$spotlight = $_GET['spotlight'];
$discount  = $_GET['discount'];
if($company==""&$new==""&$popular==""&$spotlight==""&$discount=="")header("location:/");
//$cdisp = explode("::", str_replace(" & "," &amp; ",$which_class));
include_once('header.inc');
?>
<table width="980" height="100%" 
border="0" align="center" cellpadding="0" cellspacing="0"  class="gen_tb">
  
  <tr>
    <td height="15" valign="bottom" bgcolor="#cccccc"></td>
    <td colspan="2" align="center" valign="top">
    <td width="777" align="left" valign="top" class="main-name-h">Home&gt;&gt;<?php echo $which_class ?>  
    <td valign="bottom" bgcolor="#cccccc"></td>
  </tr>
  <tr>
    <td height="1230" valign="bottom" bgcolor="#cccccc"></td>
    <td width="200" align="left" valign="top">
    <table>
    <tr><td>
<?php
include_once("categories1.inc");
?>   
</td></tr> 
<tr><td>
      <p><BR class="main-txt">
      </p>
     <?php include_once('goo-ad1.inc')?>
</td></tr> 
<tr><td>     
      <BR>
      <?php include_once('goo-ad2.inc')?>
</td></tr> 
<tr><td> 
      <br>
      <TABLE width=180 
            border=0 align="center" cellPadding=0 cellSpacing=0 
            background="images/middle.gif">
        <TBODY>
          <TR>
            <TD width="8" height="2" class="table-top"></TD>
            <TD width="172" class="table-top"></TD>
          </TR>
          <TR>
            <TD align=left vAlign=center class="left-rss">:<BR>
                <BR>
                </p>
                </p></TD>
            <TD align=left vAlign=center class="left-rss"><span class="left-b"><img src="images/rss.gif" width="36" height="14">RSS Feeds</span><br>
                <img src="images/rss-1.gif" alt="new" width="14" height="14"><a href="rss.php">New Releases and Updates</a><br>
                  <img src="images/rss-1.gif" alt="new" width="14" height="14"><a href="rss.php?feed=popular">Most Popular Software</a><br>
                  <img src="images/rss-1.gif" alt="new" width="14" height="14"><a href="rss.php?feed=rating">Top Rated Software</a>
          </TR>
          <TR>
            <TD height="8" colspan="2" class="table-bottom"></TD>
          </TR>
        </TBODY>
      </TABLE>
</td></tr> </table>
 
    <td width="1" valign="top" background="images/line--3.gif">  </td>  
    <td valign="top">
    <TABLE cellSpacing=0 cellPadding=0 width="99%" align=center border=0 >
        <TBODY>
          <TR>
            <TD height="9" colspan="2" class=main-name-h><span class="main-name-hb"><?php echo $company?></span></TD>
          </TR>
          <TR>
            <TD height="18" class=name ">&nbsp;</TD>
            <TD align="center" class=box_tbl_e><div class="main-txt"></div></TD>
          </TR>
          <TR>
            <TD  colspan="2" valign="top" class=box_tbl_e><TABLE cellSpacing=0 cellPadding=3 width="100%" align=center 
            border=0>
              <TBODY>
<?php
if($company!=""){
$sql = "SELECT * FROM paddata WHERE company LIKE '%$company%' ORDER BY pdate DESC";

}elseif ($new!=""){
$sql = "SELECT * FROM paddata ORDER BY pdate DESC LIMIT 20";

}elseif ($popular!=""){
$sql = "SELECT * FROM paddata ORDER BY dlcount DESC LIMIT 20";	

}elseif ($spotlight!=""){
$sql="SELECT * FROM paddata where spotlight=1 ORDER BY progid desc, pdate desc LIMIT 20";
}elseif ($discount!=""){
$sql="SELECT * FROM paddata where discounturl<>'' ORDER BY progid desc, pdate desc LIMIT 20";
}
 
//echo $sql;
 $database->setQuery($sql);
 $result = $database->loadAssocList();
 if($result);
  foreach ($result as $query){  
  	$progid       = $query["progid"];
	$title        = htmlspecialchars($query["title"]);
	$company      = htmlspecialchars($query["company"]);
	$version      = $query["version"];
	$pdate        = $query["pdate"];
	$status       = $query["status"];
	$description  = htmlspecialchars($query["description"]);
	$icon         = $query["icon"];
	$cost         = sprintf("%01.2f",$query["cost"]);
	$os           = str_replace(",",", ",$query["os"]);
	$descrlarge   = nl2br(htmlspecialchars($query["descrlarge"]));
	$descrlarge   = $database->noBreakWord($descrlarge,$max);
	$ksize        = number_format($query["ksize"]/1024, 2, '.', '');
	$msize 		  = number_format($query["ksize"]/1024/1024, 2, '.', '');
	if($msize>1){
		$ksize = $msize." M";
	}else {
		$ksize = $ksize." KB";
	}
	$discounturl  = $query["discounturl"];
	if($discounturl!="")$discounturl_img = "<a href=$discounturl><img src=images/discount-10p.gif border=0 height=12 width=23></a>";
	if($icon == "none") $iconimg = "images/noicon.gif";
	else $iconimg = $icon;
	$screenshot   = $query["screenshot"];
	if($screenshot=="none")   
    $screenshot   = "./images/screenshot.gif";
    if($status==1){
		$pic = "<img src=\"images/upd.gif\" width=\"61\" height=\"21\">";
	}else {
		$pic = "<img name=\"\" src=\"images/new.gif\" width=\"23\" height=\"12\" alt=\"\">";
	}
    $buynowlnk = "";
	if($affiliate && $affiliateid) {
		$pick = "<img name=\"\" src=\"images/pick.gif\" width=\"23\" height=\"12\" alt=\"\">";
		if($affiliate == "RegNow") {
			$affiliatelnk = "https://www.regnow.com/softsell/nph-softsell.cgi?affiliate=" . $regnowafl . "&item=" . $affiliateid;
		}
		if($affiliate == "Share-It") {
			$affiliatelnk = "https://secure.shareit.com/shareit/checkout.html?affiliateid=" . $shareitafl . "&productid=" . $affiliateid;
		}
		if($affiliate == "eSellerate") {
			$affiliatelnk = "http://store.esellerate.net/a.asp?c=0_" . $affiliateid . "_" . $esellerateafl;
		}
		if($affiliate == "Plimus") {
			$affiliatelnk = "https://www.plimus.com/jsp/buynow.jsp?contractId=" . $affiliateid . "&referrer=" . $plimusafl;
		}
		if($affiliatelnk) {
			$buynowlnk = $affiliatelnk ;
		}
	}           
         echo"<TR>
              <TD width=\"14%\" height=\"122\" vAlign=middle class=\"main-txt\"><p><img name=\"\" src=\"$screenshot\" width=\"100\" height=\"100\" alt=\"\"></p></TD>
              <TD width=\"69%\" vAlign=top class=\"main-txt\"><img align=absMiddle src='$iconimg' width=28 height=30 > <span class=\"main-name\"><a href='index04_p_$progid.html'>$title.$version</a></span>
                 $pick.
	$pic.$discounturl_img<br>
                    $descrlarge......<br>
                              <strong>Publisher: </strong>$company<br>
                              <strong>File Size: </strong>$ksize <br>
                              <strong>OS: </strong>$os <br>
                              <strong>Software Terms: </strong>dvd to psp, dvd converter </TD>
                  <TD width=\"17%\" align=\"center\" vAlign=middle class=\"main-txt\"><div class=\"bdd\">
                    <p><font color=red>$ $cost </font><a href=$buynowlnk>Buy full version </a></p>
                    <p><a href=download_p_$progid.html>
        [Download $ksize ]</a></p>
                    <p> <strong>add date: </strong>$pdate </p>
                  </div></TD>
                </TR>
                 <TR>
                  <TD height=1 colspan=\"3\" bgColor=#eaeaea></TD>
                </TR>";
}        
?>               
          
                <TR>
                  <TD height=2 colspan="3" bgColor=#eaeaea></TD>
                </TR>
              </TBODY>
            </TABLE></TD>
          </TR>
          <TR valign="top">
            <TD height="57" class=box_tbl_e valign="top" ></TD>
            <TD height="57"  width="980"class=box_tbl_e valign="top" align="left"><TABLE width="100%">
              <TBODY>
                <TR>
                  <TD  height="158"><div class="name"><strong class="main-name">New releases &amp; updates</strong></div>
   <table>
<?php
##############################################New releases###########################################
$sql="SELECT * FROM paddata  ORDER BY pdate desc, status LIMIT 15";
$database->setQuery($sql);
$result = $database->loadAssocList();
foreach ($result as $query){  
	$progid       = $query["progid"];
	$title        = htmlspecialchars($query["title"]);
	$status       = $query["status"];
	$statustxt = "NEW";
	if($status == "1") {
		$statustxt = "UPd";
	}
	
echo "<tr><td><a href=\"index04_p_$progid.html\"><span class=\"nw\">$title</a></span></td><td> <font color=red size=1>$statustxt</font></td><tr>";
}        
?>
</table></TD>
                  <TD width="51%"><div class="name"><strong class="main-name">Most popular software</strong></div>
                        <table>
<?php
##############################################Most popular software###########################################
$sql="SELECT * FROM paddata ORDER BY dlcount desc, pdate desc LIMIT 15";
$database->setQuery($sql);
$result = $database->loadAssocList();
foreach ($result as $query){  
	$progid       = $query["progid"];
	$title        = htmlspecialchars($query["title"]);
	$status       = $query["status"];
	$statustxt = "NEW";
	if($status == "1") {
		$statustxt = "UPd";
	}
echo "<tr><td><a href=\"index04_p_$progid.html\"><span class=\"nw\">$title</a></span></td><td> <font color=red size=1>$statustxt</font></td><tr>";
}        
?>
</table>         </TD>
                </TR>
              </TBODY>
            </TABLE></TD>
          </TR>
        </TBODY>
      </TABLE>
      <br>
    <td valign="bottom" bgcolor="#cccccc"></td>
  </tr>
  <tr>
    <td height="2" valign="bottom" bgcolor="#cccccc"></td>
    <td colspan="3" align="center" valign="top" background="images/line-3.gif"><td>
    <td valign="bottom" bgcolor="#cccccc"></td>
  </tr>
  <tr>
    <td width="1" height="37" valign="bottom" bgcolor="#cccccc"></td>
    <td colspan="3" align="center" valign="top"><table width="905" height="30" border=0 align="center" cellpadding=0 cellspacing=0 class=letters>
      <tbody>
        <tr>
          <?php 
                  $a="A";
                  for($i=0;$i<26;$i++){
                  	 echo  "<td width=\"23\" height=\"30\" class=\"letters\"><a href=\"asearch_keyauthor_words$a.html\">$a</a></td>";
                     $a++;
                  }
                   ?>
                    <td width="23" height="30" class="letters"><a href="asearch_keyauthor_words1.html">1</a></td>
                    <td width="23" height="30" class="letters"><a href="asearch_keyauthor_words2.html">2</a></td>
                    <td width="23" height="30" class="letters"><a href="asearch_keyauthor_words3.html">3</a></td>
                    <td width="23" height="30" class="letters"><a href="asearch_keyauthor_words4.html">4</a></td>
                    <td width="23" height="30" class="letters"><a href="asearch_keyauthor_words5.html">5</a></td>
                    <td width="23" height="30" class="letters"><a href="asearch_keyauthor_words6.html">6</a></td>
                    <td width="23" height="30" class="letters"><a href="asearch_keyauthor_words7.html">7</a></td>
                    <td width="23" height="30" class="letters"><a href="asearch_keyauthor_words8.html">8</a></td>
                    <td width="23" height="30" class="letters"><a href="asearch_keyauthor_words9.html">9</a></td>
                    <td width="23" height="30" class="letters"><a href="asearch_keyauthor_words10.html">0</a></td>
                    <td width="23" height="30" class="letters"><a href="asearch_keyauthor_words#.html">#</a></td>
                    <td width="23" height="30" class="letters"><a href="asearch_keyauthor_words!.html">!</a></td>
                    <td width="29" height="30" class="letters"><a href="asearch_keyauthor_words@.html">@</a></td>
        </tr>
      </tbody>
    </table>
    <td width="1" valign="bottom" bgcolor="#cccccc"></td>
  </tr>
</table>
<?php
include_once('fooder.inc');
?>